package com.tycmc.common.dynamicloader;


public class DynamicClass {

	private DynamicClassLoader loader;

	public DynamicClass() {
		setLoader((DynamicClassLoader) this.getClass().getClassLoader());
		loader.addInstance();
	}

	public void setLoader(DynamicClassLoader loader) {
		this.loader = loader;
	}

	@Override
	protected void finalize() throws Throwable {
		loader.deleteInstance();
		super.finalize();
	}
}
